<?php
session_start();
header("Content-type: text/html; charset=utf-8");
include 'mysql.php';
if(strtolower($_SERVER['REQUEST_METHOD']) == 'post')
{
    $param = $_POST['Form'];
    $password = $param['password'];
    $name = $param['name'];

    $result = $mysqli->query("select * from user where `name`='".$name."' and `password`='".$password."' ");
    $row =$result->fetch_assoc();
    if($row['id'])
    {
        $_SESSION["email"] = $email ;
        $_SESSION["name"] = $name ;
        header("Location:/");
    }
    else
    {
        echo  "<script>alert('用户名或者密码错误');window.location.href='/'</script>";

    }

}
